/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SelectRunOptions.java
 *
 * Created on 30.Nis.2010, 14:03:51
 */
package org.testis.gui.mvc.view.testdesign;

import org.testis.gui.mvc.controller.TestDesignControllerList;
import org.testis.gui.mvc.utilities.AtofEntryItem;
import org.testis.orm.testbed.refined.DeviceGroupRefined;
import org.testis.orm.testbed.refined.DutRefined;
import org.testis.orm.testbed.refined.TestPcRefined;
import org.testis.utils.UserSettingsManager;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import org.orm.PersistentException;
import org.orm.cfg.JDBCConnectionSetting;

/**
 *
 * @author nurhat
 */
public class SelectRunOptions extends javax.swing.JDialog {

    HashMap<Integer, String> hLanguages;
    HashMap<Integer, String> hTestBeds;
    HashMap<Integer, String> hProfiles;
    HashMap<Integer, String> hTestPcs;
    HashMap<Integer, String> hDuts;

    /** Creates new form SelectRunOptions */
    public SelectRunOptions(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        loadTestBeds();
        loadPcs();
        loadProfiles();
        loadConfigs();
        cmbDutList.removeAllItems();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        saveButton = new javax.swing.JButton();
        closeButton = new javax.swing.JButton();
        cmbCurrentConfigs = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        browserSpeedSpinner = new JSpinner(new SpinnerNumberModel(600, //initial value
            100, //min
            2000, //max
            50));
    dutLabel = new javax.swing.JLabel();
    browserTypeLabel = new javax.swing.JLabel();
    browserSpeedLabel = new javax.swing.JLabel();
    pcLabel = new javax.swing.JLabel();
    browserTypeChoice = new java.awt.Choice();
    dutLabel1 = new javax.swing.JLabel();
    cmbPcList = new javax.swing.JComboBox();
    cmbDutList = new javax.swing.JComboBox();
    txtDutIp = new javax.swing.JTextField();
    cmbLanguages = new javax.swing.JComboBox();
    jLabel1 = new javax.swing.JLabel();
    cmbProfiles = new javax.swing.JComboBox();
    jLabel2 = new javax.swing.JLabel();
    cmbTestBeds = new javax.swing.JComboBox();
    jLabel3 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("TestPlan Runtime Configuration");

    saveButton.setText("Save Config");
    saveButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveButtonActionPerformed(evt);
        }
    });

    closeButton.setText("Continue");
    closeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            closeButtonActionPerformed(evt);
        }
    });

    cmbCurrentConfigs.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    cmbCurrentConfigs.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cmbCurrentConfigsItemStateChanged(evt);
        }
    });

    jButton1.setText("Load Config");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel3Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(cmbCurrentConfigs, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jButton1)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(saveButton)
            .addGap(65, 65, 65)
            .addComponent(closeButton)
            .addGap(26, 26, 26))
    );
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(closeButton)
                .addComponent(cmbCurrentConfigs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jButton1)
                .addComponent(saveButton))
            .addGap(145, 145, 145))
    );

    dutLabel.setFont(new java.awt.Font("Dialog", 0, 11));
    dutLabel.setText("DUT * :");

    browserTypeLabel.setFont(new java.awt.Font("Dialog", 0, 11));
    browserTypeLabel.setText("Browser Type * :");

    browserSpeedLabel.setFont(new java.awt.Font("Dialog", 0, 11));
    browserSpeedLabel.setText("Browser Speed * :");

    pcLabel.setFont(new java.awt.Font("Dialog", 0, 11));
    pcLabel.setText("PC Name * :");

    browserTypeChoice.add("");
    String[] choices = TestDesignControllerList.newInstance().getTestPlanController().operationGetBrowserTypes();
    for (int i=0;i<choices.length;i++) {
        browserTypeChoice.add(choices[i]);
    }

    dutLabel1.setFont(new java.awt.Font("Dialog", 0, 11));
    dutLabel1.setText("Dut IP :");

    cmbPcList.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    cmbPcList.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cmbPcListİtemStateChanged(evt);
        }
    });

    cmbDutList.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    cmbDutList.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            cmbDutListİtemStateChanged(evt);
        }
    });

    cmbLanguages.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    jLabel1.setText("Language:");

    cmbProfiles.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    jLabel2.setText("Profile:");

    cmbTestBeds.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    jLabel3.setText("Test Bed * :");

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel4Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(dutLabel)
                .addComponent(pcLabel)
                .addComponent(dutLabel1)
                .addComponent(browserTypeLabel)
                .addComponent(jLabel1)
                .addComponent(jLabel2)
                .addComponent(jLabel3)
                .addComponent(browserSpeedLabel))
            .addGap(27, 27, 27)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(cmbProfiles, 0, 487, Short.MAX_VALUE)
                .addComponent(cmbLanguages, 0, 487, Short.MAX_VALUE)
                .addComponent(browserTypeChoice, javax.swing.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE)
                .addComponent(cmbPcList, 0, 487, Short.MAX_VALUE)
                .addComponent(cmbDutList, 0, 487, Short.MAX_VALUE)
                .addComponent(txtDutIp, javax.swing.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE)
                .addComponent(cmbTestBeds, 0, 487, Short.MAX_VALUE)
                .addComponent(browserSpeedSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap())
    );
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(browserTypeLabel)
                .addComponent(browserTypeChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(browserSpeedSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(browserSpeedLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(pcLabel)
                .addComponent(cmbPcList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(dutLabel)
                .addComponent(cmbDutList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(dutLabel1)
                .addComponent(txtDutIp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(cmbLanguages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel1))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(cmbProfiles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel2))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(cmbTestBeds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel3)))
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addGap(22, 22, 22)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 624, Short.MAX_VALUE)
                .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGap(18, 18, 18))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cmbPcListİtemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbPcListİtemStateChanged
        loadDutDevices();
}//GEN-LAST:event_cmbPcListİtemStateChanged

    private void cmbDutListİtemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbDutListİtemStateChanged
        loadLanguages();
}//GEN-LAST:event_cmbDutListİtemStateChanged

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
}//GEN-LAST:event_saveButtonActionPerformed

    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
}//GEN-LAST:event_closeButtonActionPerformed

    private void cmbCurrentConfigsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbCurrentConfigsItemStateChanged
        String selectedConfig = (String) cmbCurrentConfigs.getSelectedItem();
        if (selectedConfig == null ? "" != null : !selectedConfig.equals("")) {

            String[] configs = UserSettingsManager.getInstance().getTestPlanConfigByName(selectedConfig);
            browserTypeChoice.select(configs[0]);
            browserSpeedSpinner.setValue(configs[1]);
            Iterator iter = hTestPcs.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                if (entry.getKey().toString().equals(configs[2])) {
                    cmbPcList.setSelectedItem(entry);
                    break;
                }
            }
            iter = hDuts.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                if (entry.getKey().toString().equals(configs[3])) {
                    cmbDutList.setSelectedItem(entry);
                    break;
                }
            }
            txtDutIp.setText(configs[4]);
            iter = hLanguages.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                if (entry.getKey().toString().equals(configs[5])) {
                    cmbLanguages.setSelectedItem(entry);
                    break;
                }
            }
            iter = hProfiles.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                if (entry.getKey().toString().equals(configs[6])) {
                    cmbProfiles.setSelectedItem(entry);
                    break;
                }
            }
            iter = hTestBeds.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                if (entry.getKey().toString().equals(configs[7])) {
                    cmbTestBeds.setSelectedItem(entry);
                    break;
                }
            }
            cmbTestBeds.setSelectedItem(evt);
        }

    }//GEN-LAST:event_cmbCurrentConfigsItemStateChanged
    private void loadProfiles() {
        cmbProfiles.removeAllItems();
        cmbProfiles.addItem("");
        hProfiles = TestDesignControllerList.newInstance().
                getProfileSettingsController().operationGetProfiles();
        if (hProfiles != null) {
            Iterator iter = hProfiles.entrySet().
                    iterator();
            while (iter.hasNext()) {
                cmbProfiles.addItem(new AtofEntryItem((Map.Entry) iter.next()));
            }
        }
        cmbProfiles.repaint();
        cmbProfiles.updateUI();
    }

    private void loadLanguages() {
        int pcId = 0;
        if (cmbPcList.getSelectedItem() != null && !cmbPcList.getSelectedItem().
                toString().equals("")) {
            Entry entry = (Entry) cmbPcList.getSelectedItem();
            pcId = Integer.parseInt(entry.getKey().toString());
        }
        int dutId = 0;
        if (cmbDutList.getSelectedItem() != null && !cmbDutList.getSelectedItem().
                toString().equals("")) {
            Entry entry = (Entry) cmbDutList.getSelectedItem();
            dutId = Integer.parseInt(entry.getKey().toString());
        }
        cmbLanguages.removeAllItems();
        cmbLanguages.addItem("");
        hLanguages = TestDesignControllerList.newInstance().
                getTestPlanController().operationGetLanguages(pcId, dutId);
        if (hLanguages != null) {
            Iterator iter = hLanguages.entrySet().
                    iterator();
            while (iter.hasNext()) {
                cmbLanguages.addItem(new AtofEntryItem((Map.Entry) iter.next()));
            }
        }
        cmbLanguages.repaint();
        cmbLanguages.updateUI();
    }

    private void loadDutDevices() {
        int pcId = 0;
        if (cmbPcList.getSelectedItem() != null && !cmbPcList.getSelectedItem().
                toString().equals("")) {
            Entry entry = (Entry) cmbPcList.getSelectedItem();
            pcId = Integer.parseInt(entry.getKey().toString());
        }
        cmbDutList.removeAllItems();
        cmbDutList.addItem("");
        List<DutRefined> duts = TestDesignControllerList.newInstance().
                getTestPlanController().operationGetDutList(pcId);
        if (duts != null) {
            if (hDuts == null) {
                hDuts = new HashMap<Integer, String>();
            } else {
                hDuts.clear();
            }
            for (int i = 0; i < duts.size(); i++) {
                hDuts.put(duts.get(i).getId(), duts.get(i).getName());
            }
            if (hDuts != null) {
                Iterator iter = hDuts.entrySet().iterator();
                while (iter.hasNext()) {
                    cmbDutList.addItem(new AtofEntryItem((Map.Entry) iter.next()));
                }
            }
        }
        cmbDutList.repaint();
        cmbDutList.updateUI();


    }

    private void loadTestBeds() {
        cmbTestBeds.removeAllItems();
        cmbTestBeds.addItem("");
        List<DeviceGroupRefined> deviceGroups = TestDesignControllerList.newInstance().
                getTestPlanController().operationGetTestBeds();
        if (deviceGroups != null) {
            for (int i = 0; i < deviceGroups.size(); i++) {
                if (hTestBeds == null) {
                    hTestBeds = new HashMap<Integer, String>();
                }
                hTestBeds.put(deviceGroups.get(i).getId(), deviceGroups.get(i).getName());
            }
            if (hTestBeds != null) {
                Iterator iter = hTestBeds.entrySet().
                        iterator();
                while (iter.hasNext()) {
                    cmbTestBeds.addItem(new AtofEntryItem((Map.Entry) iter.next()));
                }
            }
        }
        cmbTestBeds.repaint();
        cmbTestBeds.updateUI();
    }

    private void loadPcs() {
        cmbPcList.removeAllItems();
        cmbPcList.addItem("");
        List<TestPcRefined> pcs = TestDesignControllerList.newInstance().
                getTestPlanController().operationGetPcList();
        if (pcs != null) {
            if (hTestPcs == null) {
                hTestPcs = new HashMap<Integer, String>();
            } else {
                hTestPcs.clear();
            }
            for (int i = 0; i < pcs.size(); i++) {
                hTestPcs.put(pcs.get(i).getId(), pcs.get(i).getName());
            }
            if (hTestPcs != null) {
                Iterator iter = hTestPcs.entrySet().
                        iterator();
                while (iter.hasNext()) {
                    cmbPcList.addItem(new AtofEntryItem((Map.Entry) iter.next()));
                }
            }
        }
        cmbPcList.repaint();
        cmbPcList.updateUI();
    }

    public void loadConfigs() {
        cmbCurrentConfigs.removeAllItems();
        cmbCurrentConfigs.addItem("");
        List<String> configs = UserSettingsManager.getInstance().getTestPlanConfigs();
        if (configs != null) {
            for (int i = 0; i < configs.size(); i++) {
                cmbCurrentConfigs.addItem(configs.get(i));
            }
        }
        cmbCurrentConfigs.repaint();
        cmbCurrentConfigs.updateUI();
    }

    public static void loadUserDefinedDbDefinitions() {

        String dbUrl = UserSettingsManager.getInstance().getDbUrl();
        String dbUserName = UserSettingsManager.getInstance().getDbUserName();
        String dbPassword = UserSettingsManager.getInstance().getDbPassword();
        String dbName = UserSettingsManager.getInstance().getDbCatalogName();
        JDBCConnectionSetting connectionSetting =
                new JDBCConnectionSetting();
        connectionSetting.setConnectionURL("jdbc:mysql://" + dbUrl + "/"
                + dbName);
        connectionSetting.setDialect("org.hibernate.dialect.MySQLDialect");
        connectionSetting.setDriverClass("com.mysql.jdbc.Driver");

        connectionSetting.setUserName(dbUserName);
        connectionSetting.setPassword(dbPassword);
        try {
            org.testis.orm.manager.TestisDbPersistentManager.setJDBCConnectionSetting(
                    connectionSetting);
        } catch (PersistentException ex) {
            ex.printStackTrace();
        }

    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                loadUserDefinedDbDefinitions();
                SelectRunOptions dialog = new SelectRunOptions(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel browserSpeedLabel;
    private javax.swing.JSpinner browserSpeedSpinner;
    private java.awt.Choice browserTypeChoice;
    private javax.swing.JLabel browserTypeLabel;
    private javax.swing.JButton closeButton;
    private javax.swing.JComboBox cmbCurrentConfigs;
    private javax.swing.JComboBox cmbDutList;
    private javax.swing.JComboBox cmbLanguages;
    private javax.swing.JComboBox cmbPcList;
    private javax.swing.JComboBox cmbProfiles;
    private javax.swing.JComboBox cmbTestBeds;
    private javax.swing.JLabel dutLabel;
    private javax.swing.JLabel dutLabel1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JLabel pcLabel;
    private javax.swing.JButton saveButton;
    private javax.swing.JTextField txtDutIp;
    // End of variables declaration//GEN-END:variables
}
